<cfcomponent output="false">
	
	<!--- --->
	
	<cffunction name="renderCalendarSetup" access="public" output="true" returntype="string">
		
		<cfset var local = {} />
		
		<cfset local.states = $.run.it('resourceService.getStates') />
		<cfset local.business = $.run.it('craftivityService.getBusiness',{userID=request.session.user.id}) />

		<cfsavecontent variable="local.result">
			<div class="widget short">
				<div class="widget-form-title">Calendar Setup</div>
				
				#$.render.form(name="calendarSetupForm",method="craftivityController.saveLocationTimezone")#
			
					#$.run.it('craftivityView.renderSelect',{name="stateID",label="State",value=local.business.state_ID,query=local.states})#
			
					#$.run.it('calendarView.renderTimezoneSelect',{
						value=local.business.timezone
					})#
					
					<cfset local.dstMessage = "Check if you live in an are that observes Daylight Savings Time." />
					<div class="daylight-savings widget-input">
						<div class="widget-input-label" title="#local.dstMessage#">Observe DST</div>
						<div class="widget-input-input">
							<input name="dst" type="checkbox" value="true" title="#local.dstMessage#" <cfif local.business.dst eq 1>checked</cfif> />
							<span class="form-input-input-value user">
								<cfif local.business.dst eq 1>Yes<cfelse>No</cfif>
							</span>
						</div>
					</div>
					
					<input type="hidden" name="businessID" value="#local.business.id#" />
					<input type="hidden" name="name" value="#local.business.name#" />
					<button type="button" name="edit" onclick="Widget.edit(this);">edit</button>
					<button type="submit" name="save">save</button>
					<button type="button" name="cancel" onclick="Widget.cancel(this);">cancel</button>
				</form>
			</div>
		</cfsavecontent>

		<cfreturn local.result />
	
	</cffunction>

	<!--- --->
	
</cfcomponent>

<div class="module-left-element moveable edit">
	
<div style="clear:both;"></div>